<div id="blog">
  <div class="container">
    <%#= render :partial => "admin/shared/flashes" %>
    <div class="span-24">
      <div class="span-16">
        <div class="span-16">
          <h1>Blog Posts</h1>

          <table id="all-blog-posts" class="admin-table">
            <tr>
              <th class="id">ID</th>
              <th class="title">Title</th>
              <th class="date">Date</th>
              <th class="action" colspan="2">Actions</th>
            </tr>

            <% @blog_posts.each do |blog_post| %>
              <tr class="<%= cycle('odd','even') %>">
                <td class="id"><%= blog_post.id %></td>
                <td class="title"><%= blog_post.is_published? ? link_to(blog_post.title, blog_post_url(blog_post)) : blog_post.title %></td>
                <td class="date"><%= blog_post.created_at.strftime("%b %e, %Y") %></td>
                <td class="action edit"><%= link_to 'Edit', edit_admin_blog_post_url(blog_post.id) %></td>
                <td class="action destroy"><%= link_to 'Destroy', admin_blog_post_url(blog_post.id), :confirm => 'Are you sure?', :method => :delete %></td>
              </tr>
            <% end %>
          </table>
          <p><%#= link_to "Show all posts", :controller => "admin/blog", :show_all => "true" %></p>
          <%= link_to '+ New Blog Post', new_admin_blog_post_url, {:class => 'new buttonish'} %>
        </div>
      </div>
      <div class="span-8 last">
        <h1>Categories</h1>
        
        <table id="all-tags" class="admin-table">
          <tr>
            <th class="id">ID</th>
            <th class="title">Tag</th>
            <th class="action">Action</th>
          </tr>

          <% @tags.each do |t| %>
            <tr class="<%= cycle('odd','even') %>">
              <td class="id"><%= t.id %></td>
              <td class="title"><%= link_to t.name, category_url(t) %></td>
              <td class="action destroy"><%= link_to 'Destroy', admin_tag_url(t.id), :confirm => 'Are you sure?', :method => :delete %></td>
            </tr>
          <% end %>
        </table>
        <br />
        <div class="span-8" id="new-tag">
          <% form_for :tag, :url => admin_tags_url do |f| %>
            <p class="txt"><%= f.text_field :name %></p>
            <p class="sub"><%= submit_tag '+ New Tag', :class => "new buttonish" %></p>
          <% end %>         
        </div>
      </div>
      
    </div>
  </div>
</div>